"""
请求、解析、保存
re
pyquery

lxml
"""
import requests
import re

# re.findall()
# re.search()
# re.match()
# re.subn()
# re.sub()
# re.split()
# re.finditer()


res = requests.get("http://127.0.0.1:5000")
# print(res.text)
res = res.text
title = re.search(r'<title>(.*?)</title>', res).group(1)
# print(title)
# links = re.findall(r'<li><a href="(.*?)">超级链接(.*?)</a></li>', res)
# for link in links:
#     print(link[0], link[1])

# 多行内容的匹配
foot = re.search(r'<div class="footer">.*?<div class="container">(.*?)</div>.*?</div>', res, re.S)
print(foot.group(1).strip())